<?php
class Shiporder_main extends CI_Controller{
    public function __consruct(){
        parent::__construct();
    }
    public function index($con='user_login'){
        
        $ar=array('add_user','add_couriers','list_user','list_courier');
        $this->template->write_view('header', 'header', array('title'=>'SHIP ORDER'), $overwrite = FALSE);
      
         $nav['navigation']=array('home');
        
       //The side bar visible only when the user login
        if($this->session->userdata('user_id')>0)
            $this->template->write_view('sidebar', 'links', '', $overwrite = FALSE);
        
        // The content part of (add_courier,add_user , list_user,list_courier) is only when the user login. u cant come direclty by typing url
         
        if(in_array($con,$ar)){
             $id=$this->session->userdata('user_id');           
              if(empty($id) or $id <= 0) {
                $con='home';               
              }
        }
       // For Navigation with out using external Library
        if($con !='home')
            array_push($nav['navigation'],$con);
         
         /* NAvigation using external breadcrumb library
         if($con !='home'){
            $u= base_url().'shiporder_main/index/'.$con;
           
            $this->breadcrumb->addElement($con,$u, array('class'=>'breadcrumb_class_last'));
         }
          $barr['navigation']=$this->breadcrumb->get(); 
         */
            
        $this->template->write_view('content', $con, '', $overwrite = FALSE);
       
        $this->template->write_view('navigation', 'navigation', $nav, $overwrite = FALSE);
        $this->template->write_view('footer', 'footer', '', $overwrite = FALSE);
        $this->template->render();
    }    
}
 ?>